home *** CD-ROM | disk | FTP | other *** search
- Path: news2.iij.ad.jp!usenet
- From: A@sh0.oi.iijnet.or.jp.po.iijnet.or.jp
- Newsgroups: comp.lang.c++
- Subject: Re: How to clear screen?
- Date: Thu, 21 Mar 96 10:33:00 PDT
- Organization: Internet Initiative Japan Inc., Tokyo, JAPAN
- Message-ID: <NEWTNews.3294.827433346.h-shigeo@sh0.oi.iijnet.or.jp.po.iijnet.or.jp>
- References: <wmdjuBAE7oRxEwQ2@ryton.demon.co.uk>
- NNTP-Posting-Host: ppp0058.po.iijnet.or.jp
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; CHARSET=ISO-2022-JP
- X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
-
-
- In article <wmdjuBAE7oRxEwQ2@ryton.demon.co.uk>, <adam@ryton.demon.co.uk> writes:
- > Path:
- news2.iij.ad.jp!nf0.iij.ad.jp!news.iij.ad.jp!wnoc-tyo-news!matsu.nis.co.jp!aa.com!villon.nig.ac.jp!newssinet!sinetnews!news.join.ad.jp!newsxfer.itd.umich.edu!news.mathworks.com!u
- unet!in2.uu.net!tank.news.pipex.net!pipex!dispatch.news.demon.net!demon!ryton.demon.co.uk!adam
- > From: Adam Partridge <adam@ryton.demon.co.uk>
- > Newsgroups: comp.lang.c++
- > Subject: Re: How to clear screen?
- > Date: Wed, 13 Mar 1996 09:00:52 +0000
- > Organization: Chadwell Securities Ltd.
- > Lines: 59
- > Distribution: world
- > Message-ID: <wmdjuBAE7oRxEwQ2@ryton.demon.co.uk>
- > References: <c5a_9603070338@csource.blaze.net.au>
- > NNTP-Posting-Host: ryton.demon.co.uk
- > X-NNTP-Posting-Host: ryton.demon.co.uk
- > MIME-Version: 1.0
- > X-Newsreader: Turnpike Version 1.10 <30PmlnDvHYLo3bvohTFHqOcFfN>
- >
- >
- > If you are using MS-DOS as your platform try changing the video mode:
- >
- > __asm{
- > mov ax,0003
- > int 10h
- > }
- >
- > Obviously you should change the video mode to what it was before the
- > clear.
- >
- > If you're in a graphics mode you may want to try writing bytes to screen
- > memory (the example below is if you're using Watcom, for borland use
- > _mk_fp and I think it's _FP_SEG,_FP_OFF with Microsoft)
- >
- > #define SCREEN_BYTES 200*320
- > #define CLEAR_COL 0
- >
- > void fnMyCLS(void)
- > {
- > void *pScreenMem=0xa0000;
- > memset(pScreenMem,CLEAR_COL,SCREEN_BYTES);
- > }
- >
- > !!!But be aware that some graphics modes use mapped graphics or paged
- > memory and you might find your self only clearing every fourth pixel,
- > only half of the screen or something equally as ridiculous.
- >
- > You could also write a similar routine for clearing the screen in text
- > modes I think that the memory offset is then 0xb8000 (or is it 0xb0000?)
- > and then clearing one byte == clearing one letter.
- >
- > If you're using windows have a look in the Windows API and choose
- > whichever function is most appropriate (the information that is
- > displayed before the clear may belong to a CDocument class, if you clear
- > the view, should you clear the information?)
- >
- > I tend to be careful of graphics libraries, the graphics lib with MS
- > C7.00 was S L O W, and many of the functions were easy to rewrite
- > (although you do lose much of its general nature) especially as inline
- > assembler is so easy with the Microsoft Products (and IMHO MSVC 4.0 is a
- > dream).
- >
- > If this seems very complicated then don't blame me, blame the computer,
- > it _is_ complicated under there (esp. SVGA).
- > There are other alternatives pieces of code for clearing the screen, for
- > example using standard DOS text mode 3, you could just use:
- >
- > for(unsigned char uchClearCount=0;uchClearCount<25;uchClearCount++)
- > printf("\n");
- >
- > But it ain't pretty.
- >
- > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- > Adam Partridge, Head of computing
- > Ryton Hall, Ryton, Shifnal, Shropshire, England
- > All of the opinions expressed in this E-mail are my own, my employers can
- > jolly well find their own.
- >A
-
-
-